package day4.problem3;

import java.util.Scanner;

//杨辉三角
//https://www.nowcoder.com/practice/e671c6a913d448318a49be87850adbcc?tpId=290&tqId=39928&ru=/exam/oj

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] dp = new int[n+1][n+1];
        dp[1][1] = 1;
        for(int i = 2; i<=n; i++) {
            for(int j = 1; j<=i; j++) {
                dp[i][j] = dp[i-1][j-1] + dp[i-1][j];
            }
        }

        for(int i = 1; i<=n; i++) {
            for(int j = 1; j<=i; j++) {
                System.out.printf("%5d", dp[i][j]);
            }
            System.out.println();
        }
    }
}